package kr.or.kosta.otr.persistence.usertype;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.ArrayList;

import kr.or.kosta.otr.vo.UserTypeVO;

import com.ibatis.sqlmap.client.SqlMapClient;

@Repository("UserTypeDao")
public class UserTypeDaoImpl implements UserTypeDao {
	@Resource(name="sqlMapClient")
	private SqlMapClient sqlMapClient;
	
	
	@Override
	public UserTypeVO getUserType(int userTypeId) throws SQLException {
		return (UserTypeVO)sqlMapClient.queryForObject("UserType.getUserType", userTypeId);
	}

	@Override
	public ArrayList<UserTypeVO> getAllUserType() throws SQLException {
		return (ArrayList<UserTypeVO>) sqlMapClient.queryForList("UserType.getAllUserType");
	}

}
